from django.contrib import admin
from BaseWeb.models import DetailPage, Comment, JDItemId, Tui, Category,RandomUserInfo,UpLoadFile

# Register your models here.


admin.site.register(JDItemId)
admin.site.register(Tui)
admin.site.register(Category)
admin.site.register(RandomUserInfo)
admin.site.register(UpLoadFile)

# @admin.register(Author)
# class AuthorAdmin(admin.ModelAdmin):
#     list_display=('id','username','nickName','userLevel')
#     # list_per_page设置每页显示多少条记录，默认是100条
#     list_per_page = 50
#     date_hierarchy = 'date'  # 详细时间分层筛选
#     # 筛选器
#     list_filter = ('date',)  # 过滤器
#     search_fields = ('username', 'nickName',)  # 搜索字段
#     # list_display_links = ['tbid'] #默认可编辑字段
#     # list_editable =['tbid','title','status'] #可编辑的字段
#     save_as = False
#     # 点击保存并继续编辑
#     save_as_continue = True
#     # save按钮的位置,是True则显示在页面上方



@admin.register(DetailPage)
class DetailPageAdmin(admin.ModelAdmin):
    list_display=('pageid','title','tags','tbid')
    # list_per_page设置每页显示多少条记录，默认是100条
    list_per_page = 50
    # date_hierarchy = 'date'  # 详细时间分层筛选
    # 筛选器
    list_filter = ('tags',)  # 过滤器
    search_fields = ('pageid', 'title',)  # 搜索字段
    # list_display_links = ['tbid'] #默认可编辑字段
    # list_editable =['tbid','title','status'] #可编辑的字段
    save_as = False
    # 点击保存并继续编辑
    save_as_continue = True
    # save按钮的位置,是True则显示在页面上方
    save_on_top = True\


@admin.register(Comment)
class CommentAdmin(admin.ModelAdmin):
    list_display=('id','comment_auther','comment_detailpage','likeNum')
    # list_per_page设置每页显示多少条记录，默认是100条
    list_per_page = 50
    date_hierarchy = 'date'  # 详细时间分层筛选
    # 筛选器
    list_filter = ('comment_auther',)  # 过滤器
    search_fields = ('id', 'comment_auther',)  # 搜索字段
    # list_display_links = ['tbid'] #默认可编辑字段
    # list_editable =['tbid','title','status'] #可编辑的字段
    save_as = False
    # 点击保存并继续编辑
    save_as_continue = True
    # save按钮的位置,是True则显示在页面上方
    save_on_top = True


